package cn.jaye.fabric.domain.service;

import cn.jaye.fabric.common.constants.exception.MPeerExceptionEnum;
import cn.jaye.fabric.common.constants.mapping.Table;
import cn.jaye.fabric.common.model.ServiceException;
import cn.jaye.fabric.domain.model.MPeer;
import cn.jaye.fabric.domain.repository.PeerRepository;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Jaye
 * @create 2018-05-21 9:34
 */
@Service
public class ShellService {

    @Autowired
    private PeerRepository peerRepository;

    public void createPeerYamlConfig(String peerId) {
        MPeer mPeer = peerRepository.selectOne(new EntityWrapper<MPeer>().eq(Table.Peer.peerId.getFieldValue(), peerId));
        if (mPeer != null) {
            

        } else {
            throw new ServiceException(MPeerExceptionEnum.PEER_NO_DATA);
        }
        return;
    }
}
